function keytimes(date1, date2) {/* 計算2時間毫秒差 */
	var keyw = '-';
	var str1 = date1;
	var str2 = date2;
	var array1 = str1.split(keyw);
	var array2 = str2.split(keyw);

	var Y1 = array1[0];
	var M1 = array1[1];
	var D1 = array1[2];
	var H1 = array1[3];
	var I1 = array1[4];
	var S1 = array1[5];
	var L1 = array1[6];
	var Y2 = array2[0];
	var M2 = array2[1];
	var D2 = array2[2];
	var H2 = array2[3];
	var I2 = array2[4];
	var S2 = array2[5];
	var L2 = array2[6];

	var d1 = new Date();
	d1.setYear(Y1);
	d1.setMonth(M1, D1);
	d1.setHours(H1);
	d1.setMinutes(I1);
	d1.setSeconds(S1);
	d1.setMilliseconds(L1);
	var d2 = new Date();
	d2.setYear(Y2);
	d2.setMonth(M2, D2);
	d2.setHours(H2);
	d2.setMinutes(I2);
	d2.setSeconds(S2);
	d2.setMilliseconds(L2);
	return (d2.getTime() - d1.getTime());
}

function getNowTime() {/* 獲取當前時間,精確到毫秒 */
	var now = new Date();
	var year = now.getYear();
	var month = now.getMonth() + 1;
	var day = now.getDate();
	var hour = now.getHours();
	var minute = now.getMinutes();
	var second = now.getSeconds();
	var milSecond = now.getMilliseconds();
	// var myweekday=now.getDay();
	return year + "-" + month + "-" + day + "-" + hour + "-" + minute + "-"
			+ second + "-" + milSecond;
}

function checkinput(keyCode, boxid, htxtid1, htxtid2) {
	var okvalue
	if (keyCode == 13) {
		if (document.getElementById(htxtid1).value == ''
				|| document.getElementById(htxtid2).value == '') {
			alert("輸入數據錯誤?");
			document.getElementById(boxid).value = '';
			document.getElementById(htxtid1).value = '';
			document.getElementById(htxtid2).value = '';
			return false;
		}
		okvalue = keytimes(document.getElementById(htxtid1).value, document
				.getElementById(htxtid2).value);

		document.getElementById(htxtid1).value = '';
		document.getElementById(htxtid2).value = '';
	} else {
		if (document.getElementById(htxtid1).value != '') {
			if (document.getElementById(htxtid2).value != '') {
				document.getElementById(htxtid2).value = getNowTime();
			} else {
				document.getElementById(htxtid2).value = getNowTime();
			}
		} else {
			document.getElementById(htxtid1).value = getNowTime();
		}
		if (document.getElementById(boxid).value == '') {
			document.getElementById(htxtid1).value = '';
			document.getElementById(htxtid2).value = '';
		}
		okvalue = '';
	}
	return okvalue;
}
function SubmitKeyClickrepint(obj, evt) {
	evt = (evt) ? evt : ((window.event) ? window.event : "");
	keyCode = evt.keyCode ? evt.keyCode
			: (evt.which ? evt.which : evt.charCode);

	/*var aa = checkinput(keyCode, putid, 'checktime1', 'checktime2');
	if (!aa) {
		return false;
	}
	document.getElementById('shownums').innerHTML = aa;
	if (aa != '' && aa > 150) {
		alert('禁止手動輸入');
		document.getElementById(putid).value = '';
	} else if (keyCode == 13) {
		 放入執行語句 
		alert(0);

	}
	*/
	
	if (keyCode == 13) {
		/* 放入執行語句 */
		weixin_commit();

	}

}